﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bookkeeping.Core.Persistence
{
    public interface IRepository<TEntity, TId> : IDisposable
        where TEntity : class
    {
        void Delete(TEntity entity);
        void Delete(IEnumerable<TEntity> entities);
        void Delete(TId id);
        TEntity Get(TId id);
        IList<TEntity> GetAll();
        void Insert(TEntity entity);
        void SaveChanges();
        void Load(object toInitialize);
        void AttachUnchanged(TEntity entity);
        void AttachChanged(TEntity entity);
    }
}
